package g4p.newg4p;

import g4p_controls.G4P;
import g4p_controls.GButton;
import g4p_controls.GEvent;
import g4p_controls.GGroup;
import g4p_controls.GTimer;
import g4p_controls.GWindow;
import processing.core.PApplet;

public class GroupControllerTest extends PApplet {

	GWindow window;
	GButton btnWin;
	
	GGroup group0;
	
	GButton btn0;
	GTimer timer;
	
	public void setup(){
		size(300,300);
		
		window = new GWindow(this,"GWindow", 500,0,200,200,false, JAVA2D);
		btnWin = new GButton(window.papplet, 10,20,120,24,"XXX");
		
		btn0 = new GButton(this, 10,20,120,24,"A Button");
		
		group0 = new GGroup(this);
		
		group0.addControl(btn0);
		group0.addControl(btnWin);
		
		group0.setLocalColorScheme(3000, G4P.RED_SCHEME);
		group0.fadeOut(4000, 2000);
		group0.fadeIn(8000, 2000);
		group0.fadeTo(12000, 2000, 64);
		group0.setVisible(14000, false);
		group0.setVisible(15000, true);
	}
	
	public void draw(){
		background(250);
	}
	
	public void handleButtonEvents(GButton button, GEvent event) { 
		System.out.println("Button " + System.currentTimeMillis());
	}
	
	public void timerMethod(GTimer timer) { /* code */ }
}
